package com.fyp.client.ptma.model;

import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

import android.os.Parcel;
import android.os.Parcelable;

@Root(name = "defect")
public class Defect implements Parcelable
{
	public static final String DOWNLOADER = "Downloader";
	public static final String DEVELOPER = "Developer";

	@Element
	private Long id = 0L;
	@Element(required = false)
	private String status;
	@Element
	private String commenterCode;
	@Element
	private String comment;
	@Element
	private String stringTimeStamp;

	private ApplicationVersion appVersion;

	public ApplicationVersion getAppVersion()
	{
		return appVersion;
	}

	public void setAppVersion(ApplicationVersion appVersion)
	{
		this.appVersion = appVersion;
	}

	public Long getId()
	{
		return id;
	}

	public void setId(Long id)
	{
		this.id = id;
	}

	public String getStatus()
	{
		return status;
	}

	public void setStatus(String status)
	{
		this.status = status;
	}

	public String getCommenterCode()
	{
		return commenterCode;
	}

	public void setCommenterCode(String commenterCode)
	{
		this.commenterCode = commenterCode;
	}

	public String getComment()
	{
		return comment;
	}

	public void setComment(String comment)
	{
		this.comment = comment;
	}

	public String getStringTimeStamp()
	{
		return stringTimeStamp;
	}

	public void setStringTimeStamp(String stringTimeStamp)
	{
		this.stringTimeStamp = stringTimeStamp;
	}

	public Defect()
	{

	}

	private Defect(Parcel in)
	{
		id = in.readLong();
		commenterCode = in.readString();
		comment = in.readString();
		stringTimeStamp = in.readString();
		appVersion = in.readParcelable(ApplicationVersion.class
				.getClassLoader());

	}

	public static final Parcelable.Creator<Defect> CREATOR = new Parcelable.Creator<Defect>()
	{
		public Defect createFromParcel(Parcel in)
		{
			return new Defect(in);
		}

		public Defect[] newArray(int size)
		{
			return new Defect[size];
		}
	};

	@Override
	public int describeContents()
	{
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel out, int arg1)
	{
		out.writeLong(id);
		out.writeString(commenterCode);
		out.writeString(comment);
		out.writeString(stringTimeStamp);
		out.writeParcelable(appVersion,
				Parcelable.PARCELABLE_WRITE_RETURN_VALUE);

	}

}
